def print_table(data):
    """打印格式化的表格"""
    # 表头
    print(f"{'姓名':<10} {'年龄':<6} {'分数':<8} {'等级':<6}")
    print("-" * 35)

    # 数据行
    for name,age,score in data:
        grade = 'A' if score >= 90 else 'B' if score >= 80 else 'C'
        print(f"{name:<10} {age:<6} {score:<8.1f} {grade:<6}")


# 测试数据
students = [
    ("张三", 20, 95.5),
    ("李四", 19, 82.3),
    ("王五", 21, 78.8),
    ("赵六", 20, 91.2)
]

print_table(students)
